package org.ruanjj.removenodes;

import org.ruanjj.linkedlist.ListNode;

public class Solution1 {
    public ListNode removeNodes(ListNode head){
        if(head == null){
            return head;
        }

        head.next = removeNodes(head.next);

        if(head.next != null && head.val < head.next.val){
           return head.next;
        }else{
            return head;
        }
    }
}
